Skip to content

Conversation

@jawad-arb123
Copy link
Member

Description

This PR fixes an issue where column names in table-level CHECK constraints were not properly quoted when generating CREATE TABLE statements for Oracle databases.

Fixes #100

Changes

we look at each field (column) in the schema.

If the column name appears in the constraint, it uses a regex with word boundaries (\b) to replace only whole words, avoiding partial matches (like "doc" inside "document").

and we use the QuoteIdentifier(f.DBName) to quotes the column name.

This ensures the final SQL looks like:
CONSTRAINT "doc_is_json_lax" CHECK ("doc" IS JSON(LAX))

@jawad-arb123 jawad-arb123 self-assigned this Oct 29, 2025
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Oct 29, 2025
Copy link
Contributor

@shelly-li-sl shelly-li-sl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for enabling the tests!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

OCA Verified All contributors have signed the Oracle Contributor Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

column name in the constraint is not quoted automatically

2 participants